package org.ezplatform.office.meeting.common.util;

import java.util.List;

import org.ezplatform.office.meeting.info.entity.ApplyRecord;
import org.ezplatform.office.meeting.info.service.SignedInfoService;
import org.ezplatform.office.meeting.notice.service.NoticeInfoService;
import org.ezplatform.util.context.SpringContextHolder;

/**
 * 创建周期会议数据线程
 * @author Jim
 *
 */
public class CycleMeetingThread extends Thread {

	private List<ApplyRecord> arCycleList;
	
	private List<String> newUserIdList;
	
	private String applyRecordId;
	
	private String corpId;
	
	private int isSigned;

	public CycleMeetingThread(List<ApplyRecord> arCycleList, List<String> newUserIdList, String applyRecordId,
			String corpId, int isSigned) {
		super();
		this.arCycleList = arCycleList;
		this.newUserIdList = newUserIdList;
		this.applyRecordId = applyRecordId;
		this.corpId = corpId;
		this.isSigned = isSigned;
	}

	@Override
	public void run() {
		NoticeInfoService noticeInfoService = SpringContextHolder.getBean("noticeInfoService");
		noticeInfoService.addCycleNoticeInfo(arCycleList, newUserIdList, applyRecordId, corpId);
		if(isSigned == 1) {
			SignedInfoService signedInfoService = SpringContextHolder.getBean("signedInfoService");
			signedInfoService.addCycleSignedInfo(arCycleList, newUserIdList, applyRecordId, corpId);
		}
	}
}
